#include"processbar.h"

#define NONE "\033[m"
#define BLUE "\033[0;32;34m"


const char* LABLE = "|/-\\";
char bar[NUM]= {'\0'};//注意存'\0'

void processbar(int rate)
{
    int len = strlen(LABLE);
    printf(BLUE"[%-100s]"NONE"[%d%%][%c]\r",bar,rate,LABLE[rate % len]);
    fflush(stdout);//刷新缓冲区
    bar[rate++] = STYLE;
}

